import fetch from '../service'

// 验证手机号码是否被注册过
export function docheckphone(data: { tel: string }) {
  return fetch.request({
    url: "/user/docheckphone",
    method: 'post',
    data
  })
}

// 获取短信验证码
export function dosendmsgcode(data: { tel: string }) {
  return fetch.request({
    url: "/user/dosendmsgcode",
    method: 'post',
    data
  })
}

// 验证短信验证码 
export function docheckcode(data: { tel: string, telcode: string }) {
  return fetch.request({
    url: "/user/docheckcode",
    method: 'post',
    data
  })
}

// 注册账号 
export function dofinishregister(data: { tel: string, password: string }) {
  return fetch.request({
    url: "/user/dofinishregister",
    method: 'post',
    data
  })
}

// 登录账号 
/**
 * data:
 * @param {*} loginname 
 * @param {*} password 
 * @returns 
 */
export function login(data: { loginname: string, password: string }) {
  return fetch.request({
    url: "/user/login",
    method: 'post',
    data
  })
}